package com.mxchip.livestarmobile.mobile.ui.mine

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.mxchip.livestarmobile.mobile.Appli
import com.mxchip.livestarmobile.mobile.db.AppDatabase
import com.mxchip.livestarmobile.mobile.db.entity.Account
import com.mxchip.livestarmobile.mobile.state.AppConstant
import com.orhanobut.hawk.Hawk

class MineViewModel(application: Application) : AndroidViewModel(application) {

    private val appDatabase: AppDatabase = (application as Appli).database

    private val mHxbNumber: MutableLiveData<String> = MutableLiveData()

    init {
        mHxbNumber.value = "" + Hawk.get(AppConstant.SP_LUXX_NUMBER)
    }

    val hxbNumber: LiveData<String>
        get() = mHxbNumber


    fun test(): LiveData<List<Account>> {
        return appDatabase.accountDao().getAll()
    }
}